/*
 * @FileName: app_fault.h
 * @Author: GreyQiu qiushaogui@aikosolar.com
 * @Date: 2023-07-18 10:14:33
 * @LastEditors: GreyQiu qiushaogui@aikosolar.com
 * @LastEditTime: 2023-09-13 08:57:02
 * @Description: 
 * 
 * Copyright (c) 2023, All Rights Reserved. 
 */

#ifndef __APP_FAULT_H__
#define __APP_FAULT_H__

#include <stdint.h>
#include <stdbool.h>

/**
 * @description: 故障ID定义
 */
typedef enum {
    FAULT_VIN_UVP = 0,
    FAULT_VOUT_OVP,
    FAULT_IOUT_OCP,
    FAULT_OTP1,
    FAULT_OTP2,
    FAULT_VIN_OVP,
    FAULT_NUM
} fault_id_t;

#define FAULT_CMD_OFF_MASK    0x8000    // 命令关机
#define FAULT_CMP_MASK    0x4000    // 比较器触发关机
#define FAULT_BOOT_MASK   0x2000    // BOOT关机

void app_fault_run(void);
uint16_t app_fault_get_bits(uint16_t boostId);

#endif // __APP_FAULT_H__
